<?php

/**
 * SancionAJugador filter form base class.
 *
 * @package    ehockey
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedInheritanceTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseSancionAJugadorFormFilter extends SancionFormFilter
{
  protected function setupInheritance()
  {
    parent::setupInheritance();

    $this->widgetSchema   ['jugador_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Jugador'), 'add_empty' => true));
    $this->validatorSchema['jugador_id'] = new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Jugador'), 'column' => 'id'));

    $this->widgetSchema   ['fecha_inicio'] = new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false));
    $this->validatorSchema['fecha_inicio'] = new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false))));

    $this->widgetSchema   ['fecha_fin'] = new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false));
    $this->validatorSchema['fecha_fin'] = new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false))));

    $this->widgetSchema->setNameFormat('sancion_a_jugador_filters[%s]');
  }

  public function getModelName()
  {
    return 'SancionAJugador';
  }

  public function getFields()
  {
    return array_merge(parent::getFields(), array(
      'jugador_id' => 'ForeignKey',
      'fecha_inicio' => 'Date',
      'fecha_fin' => 'Date',
    ));
  }
}
